package com.topvision.myviewtest.gscview.adapter;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.topvision.myviewtest.R;

/**
 * @author lucy
 * @date 2018-12-10 11:21
 * @description //TODO
 */

public class L_ExtendAdapter extends BaseAdapter {
    @Override
    public int getCount() {
        return 100;
    }

    @Override
    public Object getItem(int position) {
        return position;
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolder holder = null;
        if (convertView == null) {
            convertView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_recycler_study, parent, false);
            holder = new ViewHolder();
            holder.titleTv = (TextView) convertView.findViewById(R.id.textView);
            convertView.setTag(holder);
        } else {
            holder = (ViewHolder) convertView.getTag();
        }
        holder.titleTv.setText(String.valueOf(position));
        return convertView;
    }

    private class ViewHolder {
        TextView titleTv;
    }
}
